package com.cskaoyan.service;

import com.cskaoyan.bean.Cart;
import com.cskaoyan.bean.cart.bo.AddToCartBo;
import com.cskaoyan.bean.cart.bo.CartCheckoutBo;
import com.cskaoyan.bean.cart.bo.CheckCartItemBo;
import com.cskaoyan.bean.cart.bo.UpdateCartItemBo;
import com.cskaoyan.bean.cart.vo.CartCheckoutData;
import com.cskaoyan.bean.cart.vo.CartData;
import com.cskaoyan.bean.goodsbean.goodsbo.UpdateGoodsBO;

import java.sql.SQLException;
import java.util.List;

public interface CartService {
    CartData getUserCartIndex(int userId, Boolean checked);

    int cartGoodsCount(int userId);

    Cart addToCart(int userId, AddToCartBo bo) throws SQLException;

    void deleteFromCart(int userId, List<Integer> productIds) throws SQLException;

    void checkCartItems(Integer userId, CheckCartItemBo bo);

    Cart updateCartItem(Integer userId, UpdateCartItemBo bo) throws SQLException;

    Cart fastAdd(Integer userId, AddToCartBo bo) throws SQLException;

    CartCheckoutData cartCheckout(int userId, CartCheckoutBo bo) throws Throwable;

    List<Cart> selectCartItem(int userId, Integer productId, Boolean checked);

    Cart getCartById(Integer id);
}
